namespace TomatoBreak.Web
{
    using System;
    using System.Web.Mvc;

    using DomainObjects;

    [Authorize]
    public abstract class AuthenticatedController : ApplicationController, ICurrentUserAware
    {
        public virtual User CurrentUser { get; private set; }

        public virtual void SetCurrentUser(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            CurrentUser = user;
        }
    }
}